//
//  TongTableViewCell.m
//  家范
//
//  Created by 吴军虎吴军虎 on 16/4/28.
//  Copyright © 2016年 lanjue. All rights reserved.
//

#import "TongTableViewCell.h"

@interface TongTableViewCell()


@property (nonatomic,retain) UILabel *nameLabel;
@property (nonatomic,retain) UILabel *zhanglabel;
@property (nonatomic,retain) UILabel *mianlabel;
@property (nonatomic,retain)  UILabel *hanglabel;
@property (nonatomic,retain) UILabel *nianlabel;
@property (nonatomic,retain) UILabel *fenglabel;
@property (nonatomic,retain) UILabel *chalabel;
@property (nonatomic,retain) UILabel *xiaolabel;
@property (nonatomic,retain) NSMutableArray *array;

@end


@implementation TongTableViewCell

-(instancetype ) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.backgroundColor=[UIColor redColor];
        [self creatSubViews];
    }
    return self;
}

-(void)creatSubViews{
    
    
    UILabel *line = [[UILabel alloc]init];
    line.backgroundColor = [UIColor grayColor];
    line.alpha = 0.3;
    [self.contentView addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-1);
        make.left.equalTo(self.contentView).offset(140.00*AUTO_WIDTH/2);
        make.right.equalTo(self.contentView.mas_right).offset(0.00*AUTO_WIDTH/2);
        make.height.mas_equalTo(1);
        
    }];


    _txImageView=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"ni"]];
    _txImageView.layer.masksToBounds = YES;
    _txImageView.layer.cornerRadius = 105.00*AUTO_HEIGHT/4;
    [self.contentView addSubview:_txImageView];
    [_txImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(34.00*AUTO_HEIGHT/2);
        make.left.equalTo(self.contentView).offset(22.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(105.00*AUTO_WIDTH/2, 105.00*AUTO_HEIGHT/2));
            
        }];
    
   
    _nameLabel= [[UILabel alloc]init];
    _nameLabel.text = @"室内设计";
    _nameLabel.textColor=GH;
    _nameLabel.font = [UIFont fontWithName:ZIXING size:13.00*AUTO_WIDTH];
    [self.contentView addSubview:_nameLabel];
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView).offset(26.00*AUTO_HEIGHT/2);
        make.left.equalTo(_txImageView.mas_right).offset(29.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(_nameLabel.text.length*14.00*AUTO_WIDTH, 19.00*AUTO_HEIGHT));
    }];

    
    _zhanglabel=[[UILabel alloc]init];
    _zhanglabel.text=@"张叶军";
    _zhanglabel.textColor=TextGrayColor;
    _zhanglabel.font=[UIFont fontWithName:ZIXING size:13 *AUTO_WIDTH];
    [self.contentView addSubview:_zhanglabel];
    [_zhanglabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.contentView).offset(26.00 *AUTO_HEIGHT/2);
        make.left.equalTo(_nameLabel.mas_right).offset(10/2 *AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(_zhanglabel.text.length *18 *AUTO_WIDTH, 19 *AUTO_HEIGHT));
    }];

    
    _mianlabel= [[UILabel alloc]init];
    _mianlabel.text = @"面议";
    _mianlabel.textColor=[UIColor grayColor];
    _mianlabel.alpha=0.6;
    _mianlabel.font = [UIFont fontWithName:ZIXING size:12.00*AUTO_WIDTH];
    [self.contentView addSubview:_mianlabel];
    [_mianlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_nameLabel.mas_bottom).offset(4.00*AUTO_HEIGHT/2);
        make.left.equalTo(_txImageView.mas_right).offset(29.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(_nameLabel.text.length*7.00*AUTO_WIDTH, 19.00*AUTO_HEIGHT
                                         ));
    }];
    
    
    UILabel *henglabel=[[UILabel alloc]init];
    henglabel.backgroundColor=[UIColor grayColor];
    henglabel.alpha=0.6;
    [self.contentView addSubview:henglabel];
    [henglabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(_nameLabel.mas_bottom).offset(8*AUTO_HEIGHT/2);
        make.left.equalTo(_mianlabel.mas_right).offset(10/2 *AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(1 *AUTO_WIDTH, 12 *AUTO_HEIGHT));
    }];
    
    
    _hanglabel= [[UILabel alloc]init];
    _hanglabel.text = @"杭州";
    _hanglabel.textColor=[UIColor grayColor];
    _hanglabel.alpha=0.6;
    _hanglabel.font = [UIFont fontWithName:ZIXING size:12.00*AUTO_WIDTH];
    [self.contentView addSubview:_hanglabel];
    [_hanglabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_nameLabel.mas_bottom).offset(4.00*AUTO_HEIGHT/2);
        make.left.equalTo(henglabel.mas_right).offset(10.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(_nameLabel.text.length*7.00*AUTO_WIDTH, 19.00*AUTO_HEIGHT));
    }];
    
    
    UILabel *henglabel1=[[UILabel alloc]init];
    henglabel1.backgroundColor=[UIColor grayColor];
    henglabel1.alpha=0.6;
    [self.contentView addSubview:henglabel1];
    [henglabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_nameLabel.mas_bottom).offset(8*AUTO_HEIGHT/2);
        make.left.equalTo(_hanglabel.mas_right).offset(9/2 *AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(1 *AUTO_WIDTH, 12 *AUTO_HEIGHT));
    }];
    
    
    _nianlabel= [[UILabel alloc]init];
    _nianlabel.text = @"1-2年";
    _nianlabel.textColor=[UIColor grayColor];
    _nianlabel.alpha=0.6;
    _nianlabel.font=[UIFont systemFontOfSize:12.00 *AUTO_WIDTH];
    [self.contentView addSubview:_nianlabel];
    [_nianlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_nameLabel.mas_bottom).offset(0.00*AUTO_HEIGHT/2);
        make.left.equalTo(henglabel1.mas_right).offset(10.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(_nameLabel.text.length*9.00*AUTO_WIDTH, 19.00*AUTO_HEIGHT));
    }];
    
    UILabel *henglabel2=[[UILabel alloc]init];
    henglabel2.backgroundColor=[UIColor grayColor];
    henglabel2.alpha=0.6;
    [self.contentView addSubview:henglabel2];
    [henglabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_nameLabel.mas_bottom).offset(8*AUTO_HEIGHT/2);
        make.left.equalTo(_nianlabel.mas_right).offset(9/2 *AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(1 *AUTO_WIDTH, 12 *AUTO_HEIGHT));
    }];

     _fenglabel= [[UILabel alloc]init];
    _fenglabel.text = @"风格";
    _fenglabel.textColor=[UIColor grayColor];
    _fenglabel.alpha=0.6;
    _fenglabel.font = [UIFont fontWithName:ZIXING size:12.00*AUTO_WIDTH];
    [self.contentView addSubview:_fenglabel];
    [_fenglabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_nameLabel.mas_bottom).offset(4.00*AUTO_HEIGHT/2);
        make.left.equalTo(henglabel2.mas_right).offset(10.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(_nameLabel.text.length*10.00*AUTO_WIDTH, 19.00*AUTO_HEIGHT));
    }];
    
    
     _chalabel= [[UILabel alloc]init];
    _chalabel.text = @"查看了活动策划";
    _chalabel.textColor=[UIColor grayColor];
    _chalabel.alpha=0.6;
    _chalabel.font = [UIFont fontWithName:ZIXING size:12.00*AUTO_WIDTH];
    [self.contentView addSubview:_chalabel];
    [_chalabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_mianlabel.mas_bottom).offset(4.00*AUTO_HEIGHT/2);
        make.left.equalTo(_txImageView.mas_right).offset(29.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(_nameLabel.text.length*28.00*AUTO_WIDTH, 19.00*AUTO_HEIGHT));
    }];
    
    
     _xiaolabel= [[UILabel alloc]init];
    _xiaolabel.text = @"1小时前";
    _xiaolabel.textColor=[UIColor grayColor];
    _xiaolabel.alpha=0.6;
    _xiaolabel.font = [UIFont fontWithName:ZIXING size:11.00*AUTO_WIDTH];
    [self.contentView addSubview:_xiaolabel];
    [_xiaolabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView).offset(22.00*AUTO_HEIGHT/2);
        make.right.equalTo(self).offset(-8.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(_nameLabel.text.length*12.00*AUTO_WIDTH, 19.00*AUTO_HEIGHT));
    }];
    
    
    _image=[[UIImageView alloc]init];
    _image.image=[UIImage imageNamed:@"re"];
    _image.layer.masksToBounds=YES;
    _image.layer.cornerRadius=25/2;
    [self.contentView addSubview:_image];
    [_image mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(_xiaolabel.mas_bottom).offset(20/2 *AUTO_HEIGHT);
        make.right.equalTo(self).offset(-30/2 *AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(25 *AUTO_WIDTH, 25*AUTO_HEIGHT));
    }];

}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
   
}

@end
